package com.ruoyi.workSafetyStandardization.service.impl;

import java.util.Date;
import java.util.List;

import com.ruoyi.common.utils.SecurityUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.workSafetyStandardization.mapper.GradeLimitMapper;
import com.ruoyi.workSafetyStandardization.domain.GradeLimit;
import com.ruoyi.workSafetyStandardization.service.IGradeLimitService;

/**
 * 评分-评级限制Service业务层处理
 *
 * @author pengjie
 * @date 2023-12-15
 */
@Service
public class GradeLimitServiceImpl implements IGradeLimitService
{
    @Autowired
    private GradeLimitMapper gradeLimitMapper;

    /**
     * 查询评分-评级限制
     *
     * @param gradeLimitId 评分-评级限制主键
     * @return 评分-评级限制
     */
    @Override
    public GradeLimit selectGradeLimitByGradeLimitId(String gradeLimitId)
    {
        return gradeLimitMapper.selectGradeLimitByGradeLimitId(gradeLimitId);
    }

    /**
     * 查询评分-评级限制列表
     *
     * @param gradeLimit 评分-评级限制
     * @return 评分-评级限制
     */
    @Override
    public List<GradeLimit> selectGradeLimitList(GradeLimit gradeLimit)
    {
        return gradeLimitMapper.selectGradeLimitList(gradeLimit);
    }

    /**
     * 新增评分-评级限制
     *
     * @param gradeLimit 评分-评级限制
     * @return 结果
     */
    @Override
    public int insertGradeLimit(GradeLimit gradeLimit)
    {
        gradeLimit.setCreateByName(SecurityUtils.getUsername());
        gradeLimit.setCreateAt(new Date());
        gradeLimit.setCreateBy(SecurityUtils.getUserId().toString());
        return gradeLimitMapper.insertGradeLimit(gradeLimit);
    }

    /**
     * 修改评分-评级限制
     *
     * @param gradeLimit 评分-评级限制
     * @return 结果
     */
    @Override
    public int updateGradeLimit(GradeLimit gradeLimit)
    {
        return gradeLimitMapper.updateGradeLimit(gradeLimit);
    }

    /**
     * 批量删除评分-评级限制
     *
     * @param gradeLimitIds 需要删除的评分-评级限制主键
     * @return 结果
     */
    @Override
    public int deleteGradeLimitByGradeLimitIds(String[] gradeLimitIds)
    {
        return gradeLimitMapper.deleteGradeLimitByGradeLimitIds(gradeLimitIds);
    }

    /**
     * 删除评分-评级限制信息
     *
     * @param gradeLimitId 评分-评级限制主键
     * @return 结果
     */
    @Override
    public int deleteGradeLimitByGradeLimitId(String gradeLimitId)
    {
        return gradeLimitMapper.deleteGradeLimitByGradeLimitId(gradeLimitId);
    }
}
